package net.chathu.airgw.model
{
	import net.chathu.airgw.Config;
	import net.chathu.airgw.util.StringUtil;
	
	/**
	 * ...
	 * @author ze
	 */
	public class Room
	{
		protected var _id:int;
		protected var _inviteid:int;
		protected var _name:String;
		protected var _topic:String;
		public var userNum:int;
		public var modNum:int;
		protected var _isconfroom:Boolean = false;
		protected var _iscustomroom:Boolean = false;
		
		public function Room(room_id:int, invite_id:int, name:String, topic:String, usernum:int = 0, modnum:int = 0, confroom:Boolean = false, customroom:Boolean = false)
		{
			
			_id = room_id;
			_inviteid = invite_id;
			_name = name;
			_topic = topic;
			this.userNum = usernum;
			this.modNum = modnum;
			_isconfroom = confroom;
			_iscustomroom = customroom;
		}
		
		public function get id():int
		{
			return _id;
		}
		
		public function get inviteId():int
		{
			return _inviteid;
		}
		
		public function get name():String
		{
			return _name;
		}
		
		public function set name(newName:String):void
		{
			_name = newName;
		}
		
		public function get topic():String
		{
			if (_isconfroom)
			{
				return Config.IRC_CHAR_COLOR + "4" + Config.IRC_CHAR_BOLD + Config.IRC_CHAR_BOLD + _topic + Config.IRC_CHAR_COLOR;
			}
			else
			{
				return _topic + " | Moderátorok: " + modNum;
			}
		}
		
		public function get isConfRoom():Boolean
		{
			return _isconfroom;
		}
		
		public function get isCustomRoom():Boolean
		{
			return _iscustomroom;
		}
	
	}

}